class AbortController {
    constructor() {
      this.signal = new AbortSignal();
    }
 
    abort() {
      this.signal.abort();
    }
}

class AbortSignal {
    constructor() {
        this.aborted = false;
        this.onabort = null;
    }

    get aborted() {
        return this._aborted;
    }

    set aborted(value) {
        if (value) {
        this.onabort && this.onabort();
        }
    }
}


if (globalThis.window != undefined) {
    globalThis.window.AbortController = AbortController;
    globalThis.window.AbortSignal = AbortSignal;
}else if (globalThis != undefined) {
    globalThis.AbortController = AbortController;
    globalThis.AbortSignal = AbortSignal;
}
